package com.wafersystems.cloud.bo.abstractbo;

import com.wafersystems.cloud.service.InterfaceDeviceController;
import com.wafersystems.cloud.service.InterfaceMsgNotice;

public abstract class AbstractSwitchDevice {
  public InterfaceMsgNotice notice;

  public InterfaceDeviceController deviceController;

  /**
   * @Title: setNoticeTools
   * @Description: 设置通知控制器 选择 mqtt 或者 websocket
   * @param @param notice 参数
   * @author lihy
   */
  public void setNoticeTools(InterfaceMsgNotice notice) {
    this.notice = notice;
  }

  /**
   * @Title: setDeviceControllerTools
   * @Description: 发送命令控制器 了、modbus or saas
   * @param @param deviceController 参数
   * @author lihy
   */
  public void setDeviceControllerTools(InterfaceDeviceController deviceController) {
    this.deviceController = deviceController;
  }

  public void sendMsg(String msg) {
    notice.sendMsg(msg);
  }

  public abstract void open();

  public abstract void close();

  private String deviceId;

  public String getDeviceId() {
    return deviceId;
  }

  public void setDeviceId(String deviceId) {
    this.deviceId = deviceId;
  }
}
